package com.leyou.common.exception;

import lombok.Getter;
import org.joda.time.DateTime;

import java.util.Date;

/**
 * 异常响应结果类：返回给前端看的
 */
@Getter
public class ExceptionResult {
    private int status; // 状态码
    private String message; // 异常信息
    private String timestamp; // 响应的时间戳

    public ExceptionResult(LyException e){
        this.status = e.getStatus();
        this.message = e.getMessage();
        this.timestamp = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }
}
